<div id='whole'>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
   <title>Unittest Results</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link href="/site_media/css/page.css" site_media="screen" rel="Stylesheet"
   type="text/css" />
   <link href="/site_media/css/test.css" site_media="screen" rel="Stylesheet" type="text/css" />
   
    <script type="text/javascript" src="/site_media/js/MochiKit/MochiKit.js"></script>
    <script type="text/javascript" src="/site_media/js/plotkit/excanvas.js"></script>
    <script type="text/javascript" src="/site_media/js/plotkit/Base.js"></script>
    <script type="text/javascript" src="/site_media/js/plotkit/Layout.js"></script>
    <script type="text/javascript" src="/site_media/js/plotkit/Canvas.js"></script>
    <script type="text/javascript" src="/site_media/js/plotkit/SweetCanvas.js"></script>
    <script type="text/javascript" src="/site_media/js/plotkit/EasyPlot.js"></script>
</head>


<body>

    <div id="body">
        <h2>Test Results for {{ test.testname }}</h2>

    <div style="margin: 0 auto 0 auto; width: 900px;">

    {% for key in keys %}
    <p> {{ key.name }} results </p> 
    <div><canvas id="{{ key.name }}_chart" width="800" height="400"></canvas></div>
        
    {% endfor %}

    <br/>
    <table id="results_vs_runs" class="data">
        <thead>
            <tr>
                <td> index </td>
                <td> svnrev </td>
                {% for key in keys %}
                <td>{{ key.name }}</td>
                {% endfor %}
            </tr>
        </thead>
        <tbody>
            {% for result in results %}
            <tr>
                <td>
                    {{ result.count }}
                </td>
                <td>
                    {{ result.svnrev }}
                </td>
                {% for item in result.data %}
                <td>{{ item.result_value }}</td>
                {% endfor %}
            </tr>
            {% endfor %}    
        </tbody>
    </table>
    
    <script type="text/javascript">
        var hexColor = MochiKit.Color.Color.fromHexString;

        var colorScheme = [hexColor("#FF0000"),hexColor("#880000"),hexColor("#008800")];
        var chart_options = {
        "pieRadius": 0.4,
        //"colorScheme": colorScheme,
        "padding": {left: 100, right: 20, top: 10, bottom: 30},
        "shouldStroke": false ,
        }
        
        var layout_options = {
        "xOriginIsZero": false,
        };

        {% for key in keys %} 
        var layout_{{ key.name }} = new Layout("line", layout_options);
        layout_{{ key.name }}.addDatasetFromTable("{{ key.name }}", $("results_vs_runs"), xcol = 0, ycol = {{ key.id }}, lcol = 1);        
        layout_{{ key.name }}.evaluate();
        var {{ key.name }}_chart = new SweetCanvasRenderer($("{{ key.name }}_chart"), layout_{{ key.name }}, chart_options);
        {% endfor %}

        {% for key in keys %} 
            {{ key.name }}_chart.render();
        {% endfor %}
    </script>
    </div>
    
    <div class="footer"><a href="http://www.liquidx.net/plotkit/">PlotKit</a></div>    
</div>
</body></html>

</div>
